//
//  CrushUnitSprite.h
//  FruitCrush
//
//  Created by gaoyu on 15/7/8.
//
//

#ifndef __FruitCrush__CrushUnitSprite__
#define __FruitCrush__CrushUnitSprite__

#include "cocos2d.h"

USING_NS_CC;

typedef enum {
    DISPLAY_MODE_NORMAL = 0,
    DISPLAY_MODE_HORIZONTAL,
    DISPLAY_MODE_VERTICAL,
    DISPLAY_MODE_CIRCLE,
    DISPLAY_MODE_ALL,
} DisplayMode;

class CrushUnitSprite :  public Sprite
{
public:
    CrushUnitSprite();
    static CrushUnitSprite *create(int row, int col);
    static CrushUnitSprite *create(int row, int col, int maxTypeNum);
    static CrushUnitSprite *createJelly(int row, int col);
    static CrushUnitSprite *createBomb(int row, int col);
    static float getContentWidth();
    
    CC_SYNTHESIZE(int, m_row, Row);
    CC_SYNTHESIZE(int, m_col, Col);
    CC_SYNTHESIZE(int, m_imgIndex, ImgIndex);
    CC_SYNTHESIZE(bool, m_isNeedRemove, IsNeedRemove);
    CC_SYNTHESIZE(bool, m_ignoreCheck, IgnoreCheck);
    CC_SYNTHESIZE_READONLY(DisplayMode, m_displayMode, DisplayMode);
    void setDisplayMode(DisplayMode mode);
    CC_SYNTHESIZE(int, m_attackType, AttackType);
    CC_SYNTHESIZE(bool, m_isJelly, IsJelly);
    CC_SYNTHESIZE(bool, m_isBomb, IsBomb);
private:
    static int getAttackType(int index);
};


#endif /* defined(__FruitCrush__CrushUnitSprite__) */
